<?php

namespace App\Http\Middleware;

use Closure;

class recordMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        // 记录所有的路由记录 开发完成后删除
        $fp = fopen('record.txt', 'a');
        fwrite($fp, $request -> path()."\r\n");
        fclose($fp);
        return $next($request);
    }
}
